package com.itheima.aduit.config;

import org.activiti.spring.boot.AbstractProcessEngineAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;


/**
 * @author qiankaofei
 * @version 1.0
 * @date 2020/12/17 20:37
 */
@Configuration
public class DataSourceConfiguration extends AbstractProcessEngineAutoConfiguration {


    @Primary
    @Bean(name = "ds1DataSource")
    @ConfigurationProperties(prefix = "spring.datasource.act")
    public DataSource ds1DataSource(){
        return  DataSourceBuilder.create().build();
    }

    @Bean(name = "ds2DataSource")
    @ConfigurationProperties(prefix = "spring.datasource.ihrm")
    public DataSource ds2DataSource(){
        return DataSourceBuilder.create().build();
    }
}
